package dominio;

/**
 * La Clase Configuraci
 *
 */

public class Configuracio{
	 
	private int tempsmax;
	private boolean pista;
	private boolean desfer;
	private int tipusjug;
	private int nivell;
	private int torn;
	private int color;
	private int mida;
	 
	public Configuracio(){
		tempsmax = 300;
		pista = false;
		desfer = false;
		tipusjug = 0;
		nivell = 0;
		torn = 0;
		color = 0;
	}
	
	public boolean setNivell(int level){
		nivell = level;
		return true;
	}
	 
	public boolean setPista(boolean bool){
		pista = bool;
		return true;
	}
	 
	public boolean setDesfer(boolean bool){
		desfer = bool;
		return true;
	}
	 
	public boolean setTorn(int t){
		if (t<0 || t>2) return false;
		torn = t;
		return true;
	}
	
	public boolean setColor(int c){
		if (c<0 || c>1) return false;
		color = c;
		return true;
	}
	
	
	public boolean setTipusJug(int tj){
		if (tj<0 || tj>2) return false;
		tipusjug = tj;
		return true;
	}
	 
	public boolean setTempsMaxim(int tm){
		if (tm<60 || tm>3600) return false;
		tempsmax = tm;
		return true;
	}
	
	public void setMida(int mida) {
		this.mida = mida;
	}
	
	public String getConfiguracio() {
		String s;
		s = Integer.toString(tempsmax) + ',' + String.valueOf(pista) + ',' + String.valueOf(desfer) + ',' + Integer.toString(tipusjug) + ',' + Integer.toString(nivell) + ',' + Integer.toString(torn) + ',' + Integer.toString(color);
		return s;
	}

	public int getTipusJug() {
		return tipusjug;
	}
	
	public int getTempsMax() {
		return tempsmax;
	}
		 
	public boolean getPista() {
		return pista;
	}
		 
	public boolean getDesfer() {
		return desfer;
	}
		 
	public int getNivell() {
		return nivell;
	}
		 
	public int getTorn() {
		return torn;
	}
	
	public int getColor() {
		return color;
	}

	public int getMida() {
		return mida;
	}

}



